package com.you.raft.common.entity;


import lombok.*;

import java.io.Serializable;

@Setter
@Getter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppendEntryResponse implements Serializable {

    /**
     * 当前的任期号
     */
    long term;

    /**
     * 跟随者包含了匹配上 prevLogIndex 和 prevLogTerm 的日志时为真
     */
    boolean success;


    public static AppendEntryResponse fail() {
        AppendEntryResponse fail = new AppendEntryResponse();
        fail.setSuccess(false);
        return fail;
    }
}
